<template>
  <el-card class="mt-20 mr-20" shadow="never">
    <el-form label-position="top" class="goodForm">
      <div class="content-title">{{ $t('systemReboot') }}</div>
      <el-form-item>
        <template #label>
          <div class="form-label">
            <span>{{ $t('pageStr.ReboottheoperatingStr') }}</span>
          </div>
        </template>
        <el-button class="default-btn" @click="handleReboot">
          {{ $t('tabsStr.PERFORMREBOOTStr') }}
        </el-button>
      </el-form-item>
    </el-form>
  </el-card>

</template>

<script setup>
import request from '@/utils/axios'
import {ElMessage} from "element-plus";
import {useI18n} from 'vue-i18n'
const {t} = useI18n()


/**
 * 重启系统
 */
function handleReboot() {
  console.log('系统重启！')
  request.post('/system/performReboot').then(() => {
    ElMessage.success(t('successTip'))
  }).catch(() => {
    ElMessage.error(t('errorTip'))
  })
}
</script>

<style scoped>
.form-label {
  font-size: 14px;
  color: #161940;
}

.content-title {
  /*padding-left: 10px;*/
  padding-bottom: 15px;
  font-family: "Microsoft YaHei";
  /*margin-top: 10px;*/
  font-size: 17px;
  color: #161940;
  font-weight: bold;
}
</style>